/* eslint-disable */
import i18n from '@/lang'
import dayjs from 'dayjs'

export const pickerOptions = {
    shortcuts: [
        {
            text: i18n.t("helpers.today"),
            onClick(picker) {
                const start = dayjs().startOf('day').toDate();
                const end = dayjs().endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        },
        {
            text: i18n.t("helpers.yesterday"),
            onClick(picker) {
                const start = dayjs().subtract(1, 'days').startOf('day').toDate();
                const end = dayjs().subtract(1, 'days').endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        },
        {
            text: i18n.t("helpers.lastWeek"),
            onClick(picker) {
                const start = dayjs().subtract(6, 'days').startOf('day').toDate();
                const end = dayjs().endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        },
        {
            text: i18n.t("helpers.lastMonth"),
            onClick(picker) {
                const start = dayjs().subtract(1, 'months').startOf('day').toDate();
                const end = dayjs().endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        },
        {
            text: i18n.t("helpers.lastQuarter"),
            onClick(picker) {
                const start = dayjs().subtract(1, 'quarter').startOf('day').toDate();
                const end = dayjs().endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        },
        {
            text: i18n.t("helpers.lastHalfYear"),
            onClick(picker) {
                const start = dayjs().subtract(6, 'months').startOf('day').toDate();
                const end = dayjs().endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        },
        {
            text: i18n.t("helpers.lastYear"),
            onClick(picker) {
                const start = dayjs().subtract(1, 'years').startOf('day').toDate();
                const end = dayjs().endOf('day').toDate();
                picker.$emit("pick", [start, end]);
            }
        }
    ]
}
